import http from '@src/util/http'
import { objectDateToTimestamp } from 'pub-bbx-utils';

export function getAsyncApproveListInitData(params) {
  return http.get('/approve/init', params);
}

export function getAsyncArchiveListInitData(params) {
  return http.get('/archive/init', params);
}

export function getAsyncCalendarIndexInitData(params) {
  return http.post('/calendar/init', params)
}

export function getAsyncCalendarViewInitData() {
  return http.get('/setting/callcenter/view/init')
}

export function getAsyncCalendarWorkbenchInitData() {
  return http.get('/setting/callcenter/workbench/init')
}

export function getAsyncCustomerCreateInitData(params) {
  return http.get('/customer/create/init', params)
}

export function getAsyncCustomerEditInitData(params) {
  return http.get('/customer/edit/init', params)
}

export function getAsyncCustomerRegisterEditInitData(params) {
  return http.get('/customer/register/edit/init', params)
}

export function getAsyncCustomerRegisterCreateInitData(params) {
  return http.get('/customer/register/create/init', params)
}

export function getAsyncCustomerCreateByEventInitData(params) {
  return http.get('/event/createCustomer/init', params)
}

export function getAsyncCustomerListInitData(params) {
  return http.get('/customer/jump/init', params)
}

export function getAsyncCustomerSupplementInitData(params) {
  return http.get('/customer/supplementCustomerInfo/init', params)
}

export function getAsyncCustomerOnTaskInitData(params) {
  return http.get('/customer/createOnTask/init', params)
}

export function getAsyncCustomerOnEventInitData(params) {
  return http.get('/customer/createOnEvent/init', params)
}

export function getAsyncCustomerViewInitData(params) {
  return http.get('/customer/view/init', params)
}

export function getAsyncCustomerContactInitData(params) {
  return http.get('/linkman/jump/list/init', params)
}

export function getAsyncDepartMentViewInitData(params) {
  return http.post('/security/department/init', params)
}

export function getAsyncDeptHomeInitData(params) {
  return http.post('/security/tag/home/init/' + params.id)
}

export function getAsyncRoleViewInitData(params) {
  return http.post('/security/role/view/init', params)
}

export function getAsyncRoleServiceViewInitData(params) {
  return http.post('/security/role/provider/view/init', params)
}

export function getAsyncDoMySelfInitData(params) {
  return http.get('/setting/doMyself/doMyselfSet/init', params)
}

export function getAsyncDoMySelfInitData2(params) {
  return http.post('/setting/doMyself/toastList/init', params)
}

export function getAsyncImChatInitData() {
  return http.get('/security/user/getLoginUserMap');
}

export function getAsyncImDetailInitData() {
  return http.get('/security/user/getLoginUserMap');
}

export function getAsyncJobTransferInitData(params) {
  return http.post('/jobtransfer/view/init', params)
}

export function getAsyncLinkcGoodsInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncDaliyReportData(params) {
  objectDateToTimestamp(params, ['sendDate'])
  return http.post('/v_open/dailyReport/init', params)
}

export function getAsyncExportDownLoadInitData(params) {
  return http.get('/v_open/download/message/init', params)
}

export function getAsyncCategoryDetailInitData(params) {
  return http.get('/partV2/category/detail/init', params)
}

export function getAsyncCategoryCreateInitData() {
  return http.get('/partV2/category/create/init')
}

export function getAsyncCategoryEditInitData(params) {
  return http.get('/partV2/category/edit/init', params)
}

export function getAsyncCategoryListInitData() {
  return http.get('/partV2/category/list/init')
}

export function getAsyncRepertoryApplyInitData() {
  return http.get('/partV2/repertory/apply/init')
}

export function getAsyncRepertoryPersonInitData() {
  return http.get('/partV2/repertory/person/init')
}

export function getAsyncRepertoryInitData() {
  return http.get('/partV2/repertory/record/init')
}

export function getAsyncRepertoryStockInitData() {
  return http.get('/partV2/repertory/stock/init')
}

export function getAsyncPerformanceListInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncPerformanceReportInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncPortalInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncPortalSettingInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncPortalConfigInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncCalendarProductEditInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncProductEditModalInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncProductListInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncProductViewInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncProductRegisterEditInitData(params) {
  return http.get('/product/register/edit/init', params)
}

export function getAsyncProductRegisterCreateInitData(params) {
  return http.get('/product/register/create/init', params)
}

export function getAsyncProductRegisterInitData(params) {
  return http.get('/product/register/init', params)
}

export function getAsyncProductRegisterViewInitData(params) {
  return http.get('/product/register/detail/init', params)
}

export function getAsyncProductTemplateEditInitData(params) {
  return http.get('/product/edit/init', params)
}

export function getAsyncProductTemplateCreateInitData(params) {
  return http.get('/product/create/init', params)
}

export function getAsyncProductTemplateListInitData(params) {
  return http.get('/product/init', params)
}

export function getAsyncProductTemplateViewInitData(params) {
  return http.get('/product/detail/init', params)
}

export function getAsyncProductV2CreateInitData(params) {
  return http.get('/customer/product/create/init', params)
}

export function getAsyncProductV2EditInitData(params) {
  return http.get('/customer/product/edit/init', params)
}

export function getAsyncProductV2RegisterCreateInitData(params) {
  return http.get('/customer/product/register/create/init', params)
}

export function getAsyncProductV2RegisterEditInitData(params) {
  return http.get('/customer/product/register/edit/init', params)
}

export function getAsyncProductV2ProductEditInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncProductV2ProductEditModalInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncProductV2EditModalOnTaskInitData(params) {
  return http.get('/product/createOnTask/init', params)
}

export function getAsyncProductV2EditModalOnEventInitData(params) {
  return http.get('/product/createOnEvent/init', params)
}

export function getAsyncProductV2ProductListInitData(params) {
  return http.get('/customer/product/init', params)
}

export function getAsyncProductV2ProductMenuInitData(params) {
  return http.get('/productV2/catalog/edit/init', params)
}

export function getAsyncProductV2ProductMenuListInitData(params) {
  return http.get('/productV2/catalog/list/init', params)
}

export function getAsyncProductV2ProductMenuViewInitData(params) {
  return http.get('/productV2/catalog/view/init', params)
}

export function getAsyncProductV2ProductViewInitData(params) {
  return http.get('/customer/product/view/init', params)
}

export function getAsyncProductV2QrcodeInitData(params) {
  return http.get('/product/qrcode/init', params)
}

export function getAsyncBulletinCreateInitData() {
  return http.get('/info/notice/create/page/init')
}

export function getAsyncBulletinInitData() {
  return http.get('/info/notice/detail/page/init')
}

export function getAsyncBulletinListInitData() {
  return http.get('/info/notice/init')
}

export function getAsyncDocumentCreateInitData() {
  return http.get('/wiki/create/page/init')
}

export function getAsyncDocumentEditInitData(params) {
  return http.get('/wiki/edit/page/init', params)
}

export function getAsyncDocumentDetailInitData(params) {
  return http.get('/wiki/detail/page/init', params)
}

export function getAsyncRepositoryDocumentListInitData() {
  return http.get('/wiki/init')
}

export function getAsyncDocumentShareInitData(params) {
  return http.get('/v_open/wiki/view/init', params)
}

export function getAsyncDocumentShareDeleteInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncDocumentSharePermissionInvalidInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncServicePriceInitData() {
  return http.get('/service/price/init')
}

export function getAsyncServicePriceRecordInitData() {
  return http.get('/service/price/record/init')
}

export function getAsyncServicePriceViewInitData() {
  return http.post('/service/price/view/init')
}

export function getAsyncServiceProviderServiceHomeInitData(params) {
  return http.post('/security/tag/serviceProviderHome/init/' + params.id)
}

export function getAsyncServiceProviderInitData(params) {
  return http.post('/security/tag/serviceProvider/init', params)
}

export function getAsyncCalendarManageInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncSettingCustomerFieldsInitData(params) {
  return http.get('/setting/customer/fields/init', params)
}

export function getAsyncCustomerAdditionalSettingInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {
          initJson: {},
          title: '附加组件表单设置'
        }
      })
    }, 0)
  })
}

export function getAsyncSettingDocumentInitData() {
  return http.get('/setting/info/wiki/init')
}

export function getAsyncSettingPerformanceInitData(params) {
  return http.post('/setting/performance/v2/rule/init', params)
}

export function getAsyncSettingProductInitData(params) {
  return http.get('/setting/product/fields/init', params)
}

export function getAsyncSettingRegisterInitData(params) {
  return http.get('/setting/product/register/fields/init', params)
}

export function getAsyncProductV2SettingInitData(params) {
  return http.get('/setting/productV2/catalog/setting/init', params)
}

export function getAsyncProductAdditionalManageInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncSettingProductV2ProductFieldInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncProductV2ProductMenuFieldInitData(params) {
  return http.get('/setting/productV2/catalog/settingField/init', params)
}

export function getAsyncSettingServiceItemInitData() {
  return http.get('/setting/cost/serviceItem/init')
}

export function getAsyncSettingSparepartInstockInitData() {
  return http.get('/setting/sparepart/instock/init')
}

export function getAsyncSparepartRepertoryInitData() {
  return http.get('/setting/sparepart2/repertory/init')
}

export function getAsyncTaskAdditionalSettingInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncTaskAdditionSettingInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncTaskSpareServiceViewInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsynctaskMaterialApplyViewInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsynctaskFaultListViewInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncSettingTaskSettingInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncTaskTypeSettingInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncSettingTaskTypeSettingInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncSuperQrcodeInitData(params) {
  return http.get('/setting/productV2/catalog/setting/qrcodeSet/init', params)
}

export function getAsyncSystemMallInitData(params) {
  return http.get('/setting/serviceStation/partShop/init', params)
}

export function getAsyncTaskEditInitData(params, url) {
  return http.get(url, params);
}

export function getAsyncTaskEditAllotInitData(params, url) {
  return http.get(url, params);
}

export function getAsyncTaskListInitData(params) {
  return http.get('/task/init', params);
}

export function getAsyncTaskViewInitData(params) {
  return http.get('/task/viewV2/init', params);
}

export function getAsyncTaskPlanTaskViewInitData(params) {
  return http.get('/api/task/outside/task/list/plantask/init', params);
}

export function getAsyncTeamV2EditInitData(params) {
  return http.post('/security/tag/createDept/init', params)
}

export function getAsyncTeamV2EditInitData2(params) {
  return http.post('/security/tag/editDept/init/' + params.id)
}

export function getAsyncFinanceMessageInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncPersonFinanceReportListInitData() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        succ: true,
        data: {}
      })
    }, 0)
  })
}

export function getAsyncBillViewInitData(params) {
  return http.post('/payment/paymentBillOnline/init', params)
}

export function getAsyncSystemFrameInitData(params) {
  return http.get('/homePage/init', params)
}

export function getAsyncReportListInitData(params) {
  return http.get('/performance/v2/report/init', params)
}

export function getAsyncReportDescInitData(params) {
  return http.get('/performance/v2/report/desc/init', params)
}


